package com.jpetrinet.core;

import java.util.*;

public abstract class Object {
	
	private String id;
	private Map<String, Label> labels = new HashMap<String,Label>();
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Map<String, Label> getLabels() {
		return labels;
	}
	public void setLabels(Map<String, Label> labels) {
		this.labels = labels;
	}
	
	public void addLabel(String name, Label label) {
		labels.put(name, label);
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(java.lang.Object obj) {
		
		Object other = (Object) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;

		return true;
	}
	
	
}
